<%@ page language="java"  pageEncoding="UTF-8"%>
<%@ taglib prefix="s" uri="/struts-tags"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta name="format-detection" content="telephone=no,email=no,adress=no">
<link href="<%=request.getContextPath()%>/css/global.css" type="text/css" rel="stylesheet" />
<link href="<%=request.getContextPath() %>/js/easyui/themes/metro/easyui.css" type="text/css" rel="stylesheet"/>
<link href="<%=request.getContextPath() %>/js/date/skin/WdatePicker.css" type="text/css" rel="stylesheet"/>
<link href="<%=request.getContextPath()%>/js/autocomplate/jquery.autocomplete.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="<%=request.getContextPath() %>/js/jquery.js"></script>
<script type="text/javascript" src="<%=request.getContextPath() %>/js/global.js"></script>
<script type="text/javascript" src="<%=request.getContextPath() %>/js/easyui/easyui.js"></script>
<script type="text/javascript" src="<%=request.getContextPath() %>/js/date/WdatePicker.js"></script>
<script type="text/javascript" src="<%=request.getContextPath()%>/js/autocomplate/jquery.autocomplete.js"></script>
<script type="text/javascript">

$(function(){
	$('#merNo').autocomplete({
    	serviceUrl: '<%=request.getContextPath()%>/merchant_auto.html',
    	minChars:1,
    	paramName:'merNo',
    	transformResult: function(response) {
		　　return {
		　　　　suggestions: $.map($.parseJSON(response), function(dataItem) {
		　　　　　　return { value: dataItem.merNo, data: dataItem.merName};
		　　　　})
		　　};
		},
    	formatResult:function (suggestion, currentValue) {
    		return "[" + suggestion.value.replace(currentValue,"<strong>"+currentValue+"</strong>")+ "]" + suggestion.data;
    	}
});

});
</script>
</head>
<body >
<div id="dataSearch" >    
<form id="sform" action="form_merchant.html" method="get" enctype="multipart/form-data">
<table style="width: 100%;">
<tr><td height="30" >
<s:textfield  id="merNo" name="keyNo" placeholder="商户编号"></s:textfield>
<s:textfield  id="dateTop"  name="dateTop" placeholder="日期起"  onclick="WdatePicker();"  cssStyle="width:100px;" ><s:param name="value"><s:date name="dateTop" format="yyyy-MM-dd"/></s:param></s:textfield>
 - 
<s:textfield  id="dateEnd"  name="dateEnd" placeholder="日期止"  onclick="WdatePicker();"  cssStyle="width:100px;" ><s:param name="value"><s:date name="dateEnd" format="yyyy-MM-dd"/></s:param></s:textfield>
<input type="button" class="submit" value="查询搜索" onclick="sform.submit();"/>
<input type="button" class="submit" value="今天记录" onclick="location.href=winUrl(winUrl(location.href,'dateTop',getDate(0)),'dateEnd',getDate(0)) "/>
<input type="button" class="submit" value="昨天记录" onclick="location.href=winUrl(winUrl(location.href,'dateTop',getDate(-1)),'dateEnd',getDate(-1)) "/>
<input type="button" class="submit" value="前天记录" onclick="location.href=winUrl(winUrl(location.href,'dateTop',getDate(-2)),'dateEnd',getDate(-2)) "/>
<input type="button" class="submit" value="最近一周" onclick="location.href=winUrl(winUrl(location.href,'dateTop',getDate(-7)),'dateEnd',getDate(0)) "/>
<input type="button" class="submit" value="最近一月" onclick="location.href=winUrl(winUrl(location.href,'dateTop',getDate(-30)),'dateEnd',getDate(0)) "/>
<input type="button" class="submit" value="最近一年" onclick="location.href=winUrl(winUrl(location.href,'dateTop',getDate(-365)),'dateEnd',getDate(0)) "/>
<input type="button" class="submit" value="全部记录" onclick="location.href=winUrl(winUrl(location.href,'dateTop','1970-01-01'),'dateEnd',getDate(0)) "/>
</td>
</tr>
<tr><td><hr/></td></tr>
<tr>
	<td>
			</td>
</tr>
</table>
</form>
</div>

<center>
<table width="100%" border="0">
		<tr>
			<td height="30" colspan="4" align="left">&nbsp;
			<b>收入总金额 : <s:text name="global.format.money"><s:param value="formMap.bmSummary.bmTotal+formMap.smSummary.smTotal" /></s:text> 元</b> 
			<b>支出总金额 : <s:text name="global.format.money"><s:param value="formMap.mbSummary.mbTotal+formMap.msSummary.msTotal" /></s:text> 元</b>
			<b>差额(收入-支出) : <s:text name="global.format.money"><s:param value="formMap.bmSummary.bmTotal+formMap.smSummary.smTotal-formMap.mbSummary.mbTotal-formMap.msSummary.msTotal" /></s:text> 元</b>
			</td>
		</tr>
		
		<tr>
			<td height="30" align="left" width="25%">&nbsp;<b>BM 总笔数 : <s:text name="global.format.count"><s:param value="formMap.bmSummary.bmCount" /></s:text> 笔 总金额 : <s:text name="global.format.money"><s:param value="formMap.bmSummary.bmTotal" /></s:text> 元</b></td>
			<td height="30" align="left" width="25%">&nbsp;<b>SM 总笔数 : <s:text name="global.format.count"><s:param value="formMap.smSummary.smCount" /></s:text> 笔 总金额 : <s:text name="global.format.money"><s:param value="formMap.smSummary.smTotal" /></s:text> 元</b></td>
			<td height="30" align="left" width="25%">&nbsp;<b>MB 总笔数 : <s:text name="global.format.count"><s:param value="formMap.mbSummary.mbCount" /></s:text> 笔 总金额 : <s:text name="global.format.money"><s:param value="formMap.mbSummary.mbTotal" /></s:text> 元</b></td>
			<td height="30" align="left" width="25%">&nbsp;<b>MS 总笔数 : <s:text name="global.format.count"><s:param value="formMap.msSummary.msCount" /></s:text> 笔 总金额 : <s:text name="global.format.money"><s:param value="formMap.msSummary.msTotal" /></s:text> 元</b></td>
		</tr>
		<tr>
			<td height="30" align="left" width="25%" valign="top">
				<table width="100%" border="1">
					<s:iterator value="formMap.bmList" id="show">
						<tr>
							<td height="30" align="left" width="35%">&nbsp;<s:property  value="#show.bmType"/></td>
							<td height="30" align="left" width="30%">&nbsp;<s:text name="global.format.count">
									<s:param value="bmCount" />
								</s:text>&nbsp;笔</td>
							<td height="30" align="left" width="35%">&nbsp;<s:text name="global.format.money">
									<s:param value="bmTotal" />
								</s:text>&nbsp;元</td>
						</tr>
					</s:iterator>
				</table>
			</td>
			<td height="30" align="left" width="25%" valign="top">
				<table width="100%" border="1">
					<s:iterator value="formMap.smList" id="show">
						<tr>
							<td height="30" align="left" width="35%">&nbsp;<s:property  value="#show.smType"/></td>
							<td height="30" align="left" width="30%">&nbsp;<s:text name="global.format.count">
									<s:param value="smCount" />
								</s:text>&nbsp;笔</td>
							<td height="30" align="left" width="35%">&nbsp;<s:text name="global.format.money">
									<s:param value="smTotal" />
								</s:text>&nbsp;元</td>
						</tr>
					</s:iterator>
				</table>
			</td>
			<td height="30" align="left" width="25%" valign="top">
				<table width="100%" border="1">
					<s:iterator value="formMap.mbList" id="show">
						<tr>
							<td height="30" align="left" width="35%">&nbsp;<s:property  value="#show.mbType"/></td>
							<td height="30" align="left" width="30%">&nbsp;<s:text name="global.format.count">
									<s:param value="mbCount" />
								</s:text>&nbsp;笔</td>
							<td height="30" align="left" width="35%">&nbsp;<s:text name="global.format.money">
									<s:param value="mbTotal" />
								</s:text>&nbsp;元</td>
						</tr>
					</s:iterator>
				</table>
			</td>
			<td height="30" align="left" width="25%" valign="top">
				<table width="100%"  border="1">
					<s:iterator value="formMap.msList" id="show">
						<tr>
							<td height="30" align="left" width="35%">&nbsp;<s:property  value="#show.msType"/></td>
							<td height="30" align="left" width="30%">&nbsp;<s:text name="global.format.count">
									<s:param value="msCount" />
								</s:text>&nbsp;笔</td>
							<td height="30" align="left" width="35%">&nbsp;<s:text name="global.format.money">
									<s:param value="msTotal" />
								</s:text>&nbsp;元</td>
						</tr>
					</s:iterator>
				</table>
			</td>
			
			
		</tr>
	</table>
</center>

<br/>
<br/>
<br/>
</body>
</html>
